<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('发单商品列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>游戏名称：</label>
                            <select name="gameType" class="form-control m-b"  th:with="type=${@dict.getType('dl_game_name')}" required>
                                <option value="">请选择</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </li>
                        <li>
                            <label>是否托管：</label>
                            <select name="isHosting" class="form-control m-b"  th:with="type=${@dict.getType('dl_is_hosting')}" required>
                                <option value="">请选择</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </li>
                        <!--<li>-->
                            <!--<label>游戏区服：</label>-->
                            <!--<input type="text" name="gameArea"/>-->
                        <!--</li>-->
                        <li>
                            <label>微信昵称：</label>
                            <input type="text" name="wxName"/>
                        </li>
                        <li>
                            <label>游戏账号：</label>
                            <input type="text" name="gameUnumber"/>
                        </li>
                        <!--<li>-->
                        <!--<label>英雄名称：</label>-->
                        <!--<input type="text" name="heroName"/>-->
                        <!--</li>-->

                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="dl:goods:add">-->
            <!--<i class="fa fa-plus"></i> 添加-->
            <!--</a>-->
            <!--<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="dl:goods:edit">-->
            <!--<i class="fa fa-edit"></i> 修改-->
            <!--</a>-->
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="dl:goods:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="dl:goods:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
</body>
</html>









<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('dl:goods:edit')}]];
    var removeFlag = [[${@permission.hasPermi('dl:goods:remove')}]];
    var prefix = ctx + "dl/goods";
    var typeDatas = [[${@dict.getType('dl_is_hosting')}]];
    var typeData = [[${@dict.getType('anti_addiction')}]];


    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "发单商品",
            columns: [{
                checkbox: true
            },
                {
                    field: 'goodsNumber',
                    title: '发单号'
                },
                {
                    field: 'isHosting',
                    title: '是否托管',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(typeDatas, value);
                    }
                },
                {
                    field: 'user.wxName',
                    title: '微信昵称'
                },
                {
                    field: 'user.phone',
                    title: '发单人手机'
                },
                {
                    field: 'dlRecreation.gameName',
                    title: '游戏名称'
                },
                {
                    field: 'gameArea',
                    title: '游戏区服'
                },
                {
                    field: 'inscriptionsNumber',
                    title: '铭文等级'
                },
                {
                    field: 'heroNumber',
                    title: '英雄数量'
                },
                {
                    field: 'nowDan',
                    title: '当前段位'
                },
                {
                    field: 'targetDan',
                    title: '目标段位'
                },
                {
                    field: 'timeLimit',
                    title: '时限'
                },
                {
                    field: 'gameUnumber',
                    title: '游戏账号'
                },
                // {
                //     field: 'gamePassward',
                //     title: '游戏密码'
                // },
                {
                    field: 'heroName',
                    title: '英雄'
                },
                {
                    field: 'orderPrice',
                    title: '价格'
                },
                {
                    field: 'bzMoney',
                    title: '保证金'
                },
                {
                    field: 'xlMoney',
                    title: '效率金'
                },
                {
                    field: 'antiAddiction',
                    title: '是否有防沉迷',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(typeData, value);
                    }
                },
                {
                    field: 'taker',
                    title: '接单人'
                },
                {
                    field: 'requirements',
                    title: '要求',
                    width: 'auto',
                    formatter: function(value, row, index) {
                        var str='';
                        if(value.length>3){
                            str= value.substring(0,3);
                        }else{
                            str=value;
                        }
                        return '<p style="overflow:hidden; text-overflow:ellipsis; white-space:nowrap; word-break: keep-all;" title="'+value+'">'+str+'...</p>';
                    }

                },
                {
                    field: 'orders.id',
                    title: '接单状态',
                    formatter: function(value, row, index) {
                        var str="未接单";
                        if(value){
                            str="已接单";
                        }
                        return str;
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
